package com.itheima12;

import java.time.LocalDateTime;

/**
 * @author Xiao
 * @date 2021/7/21
 */
public class LocalDateTimeDemo04 {
    public static void main(String[] args) {
        LocalDateTime time = LocalDateTime.of(2000, 10, 11, 12, 13, 14);
        System.out.println(time);   //2000-10-11T12:13:14
        LocalDateTime time1 = time.minusDays(1);
        System.out.println(time1);  //2000-10-10T12:13:14
        LocalDateTime time2 = time.minusHours(-2);
        System.out.println(time2);  //2000-10-11T14:13:14
        System.out.println("---------");
        LocalDateTime time3 = time.withHour(9);
        System.out.println(time3);  //2000-10-11T09:13:14
        LocalDateTime time4 = time.withYear(2020);
        System.out.println(time4);  //2020-10-11T12:13:14

    }
}
